let db = require('../db/index')

exports.get = (req, res) => {  //向user表添加数据
    var sql = 'insert into user (username,name,password,address,phone,birth,gender) values (?,?,?,?,?,?,?)'
    db.query(sql, [req.query.username, req.query.name, req.query.password, 
        req.query.address, req.query.phone, req.query.birth, req.query.gender], (err, data) => {
        if(err) {
            return res.send('错误：' + err.message)
        }
        res.send(data)
    })
}